const statistics = require('../methods/statistics')

module.exports = {
    echartOptionsData: {
        exp: '获取统计图数据',
        method: 'get',
        async func(data) {
            data = data.query
            if (data.type == 'patrol_total') return await statistics.patrol.total()
            if (data.type == 'patrol_preToDo') return await statistics.patrol.preToDo()
            if (data.type == 'patrol_finished') return await statistics.patrol.finished()
            if (data.type == 'patrol_campus') return await statistics.patrol.campus()
            if (data.type == 'patrol_category') return await statistics.patrol.category()
            if (data.type == 'patrol_campusCategory') return await statistics.patrol.campusCategory(parseInt(data.campusId), parseInt(data.categoryId))
            if (data.type == 'patrol_user') return await statistics.patrol.user(parseInt(data.userId))
            if (data.type == 'patrol_handler') return await statistics.patrol.handler(parseInt(data.userId))
            if (data.type == 'patrol_handlerReview') return await statistics.patrol.handlerReview(parseInt(data.userId))
            if (data.type == 'patrol_handlerEndTime') return await statistics.patrol.handlerEndTime(parseInt(data.userId))
        }
    },
    home: {
        exp: '首页统计数据',
        method: 'get',
        async func(data) {
            return await statistics.home()
        }
    }
}